'''
Created on 2009-10-20

@author: dell
'''
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template

class Tpl(webapp.RequestHandler):
    '''
    classdocs
    '''
    styleroot = ""
    
    def setStylePath(self,pathname):
        self.styleroot = pathname
        
    def display(self,tplfile,tplval): 
         
        
        tplroot = os.path.join(os.path.dirname(__file__), '../../templates/'+self.styleroot)
        path = os.path.join(tplroot,tplfile)
        fullpath = template.render(path, tplval)
        self.response.out.write(fullpath)
    def goto(self,uri):
        self.redirect(uri+"?rt="+self.request.uri)